<?php
include('groups.php');
?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>New Expense</title>
    </head>
    <body>
        <a href="index.php">Back to the list of expenses</a>
        <form method="post" action="addexpense.php">
            Date: <input style="display: block" type="text" name="date" value="dd.mm.yyyy">
            Name: <input style="display: block" type="text" name="name">
            Cost: <input style="display: block" type="text" name="cost">
            Type: <select style="display: inline" name="type">
            <?php 
                foreach($groups as $key=>$value)
                {
                    if($key == 1)
                    {
                        continue;
                    }
                    echo '<option value="'.$key.'">'.$value.'</option>';
                }
            ?>
            </select>
            <input style="display: block" type="submit" value="Add expense">
        </form>
    </body>
</html>
